﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Hands.EventBus;
namespace Test.Event.BusTest
{
    public class Handler1
    {
        private static Handler1 instance;

        public static void init()
        {
            instance = new Handler1();
        }

        public Handler1()
        {
            Factory factory = new EventCenterFactory();
            IHandlerRegistration register = factory.getRegistrationInstance();
            register.register(typeof(TestEvent), new Handler(this.handler));
        }

        public void handler(Hands.EventBus.Event message)
        {
            TestEvent test = (TestEvent)message;
            Console.Write(test.message);
        }

        public void callback<T>(T message) where T : class
        {
            throw new NotImplementedException();
        }
    }
}
